Repository navigation
fix(runtime): a channel list with a member off the declared shape is not judged at the automation save doors - #33970
Conversation
…not judged at the automation save doors
A getKnownChannels() list with any member that is not { id: string } is now
an unreadable registry (not judged), like a reader that throws or answers no
list; dropping such members left a roster that refused every channel. The
notify-channel-unknown-refused semantic entry now names every not-judged
case and the paths a refusal names. Data text only in packages/spec.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jUZKdq3PK2Sab53cT3
📓 Docs Drift Check1 anchor(s) derived from 2 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 178 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin b75c9a32b42b831c5a7e0c78d524fef527ffae98 && git checkout b75c9a32b42b831c5a7e0c78d524fef527ffae98
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 895783a1e864e0fe629c56b3c6315771ca87bf87 f3979189f3e0a90cf559147254dc4d5a4797c8b8 && git checkout -B drift-repro 895783a1e864e0fe629c56b3c6315771ca87bf87 && git merge --no-ff f3979189f3e0a90cf559147254dc4d5a4797c8b8
node scripts/docs-audit/affected-docs.mjs --json 895783a1e864e0fe629c56b3c6315771ca87bf87 |
|
domain:server#5 · zhuangjianguo · session_01QsR2jUZKdq3PK2Sab53cT3 Request: review · PR #33970 · area S6 · Fixes #32733 · head
Generated by Claude Code |
|
domain:server#5 · zhuangjianguo · session_01QsR2jRMKz5NhWVrE4E1U5x Contract reviewServed-tier: ① Derived judgments
② Semver level
Clause-②: no. It holds. The one case that moves from 400 to 200 is reachable only through a messaging service that breaks the reader contract the check declares ( Changeset sentences read against the head: true, with one overstatement, N1 below. ③ Boundary flags
④ Design judgmentEntry
Test pin (lane ACCEPT): both shapes save 200 naming No must-fix, no should-fix.
Implemented-by: VERDICT: PASS |
|
domain:server#5 · zhuangjianguo · session_01QsR2jRMKz5NhWVrE4E1U5x Review — PASSHead-sha:
No must-fix, no should-fix. |
|
domain:server#5 · zhuangjianguo · session_01QsR2jUZKdq3PK2Sab53cT3 席位核对ACCEPT · area S6 lands PR #33970 at head
Generated by Claude Code |
…y its read action does not declare, as connector_action does (objectstack-ai#34089) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbTGhxJSYAmQXU7efVdNqrpw)_ Fixes objectstack-ai#33894 Clause-②: no (narrowing) — a mapping whose `connectorSource.input`, or the watermark parameter the pull adds to its `query`, carries a key the read action's `inputSchema` does not declare used to pull and send that key to the provider; the pull now fails before the call with `VALIDATION_ERROR`. Nothing published widens: no export, no key, no option is added. First-party mappings affected: 0 (no `connectorSource` under `examples/` or `packages/apps/`). Metadata-protocol: narrowed Skills-docs: none — `git grep -i 'connectorSource|watermark' -- skills/` has 0 hits: no published skill teaches the connector pull door's input ## 维护者速读 - 改了什么:映射的连接器拉取入口(`connectorSource.input`)也像 `connector_action` 节点一样,拒收读取动作 `inputSchema` 未声明的输入键,包括拉取入口自己加进 `query` 的水位参数(如 `since`);拒绝时报 `VALIDATION_ERROR`,点名该键和修法,不调用外部服务、不写入。 - 为什么改:维护者裁决 6896271476「多余参数直接报错」:凡是调用连接器动作的入口,对输入一视同仁;以后新入口直接继承,不再回来要裁决。 - 风险与回滚:收窄。定时拉取没有 fault 边,带多余键的映射每次运行都失败(`sys_sync_run` 记 failed),直到映射或 OpenAPI 文档修好;水位参数只在目标已有值后才发送,所以首拉成功、第二次起失败。第一方受影响 0 处;rest 连接器的 `query` 是开放的,不受影响。回滚 = revert 本 PR。 - 先看:`packages/services/service-automation/src/connector-pull.ts` 的判定段(打开 `refuseUndeclaredKeys`,以及单独判定水位参数以便在拒绝句里点名它);`connector-pull-undeclared-input-key.test.ts`;changeset 的迁移说明。 - 两分钟验证:`pnpm --filter @objectstack/service-automation exec vitest run src/connector-pull-undeclared-input-key.test.ts src/connector-pull.test.ts`,预期全部通过(新文件 6 个用例,翻转后的拒绝 pin 在 `connector-pull.test.ts`)。 - 需要你做的:无,席位落地(合同档复核由区域安排)。 ## What changes - `packages/services/service-automation/src/connector-pull.ts`: the pull door judges the input it is about to send with `judgeConnectorInput(..., { refuseUndeclaredKeys: true })`, as `connector_action` does (ruling 6896271476: every door that dispatches a connector action judges its input alike). The refusal keeps its `VALIDATION_ERROR` 400 `input_schema_mismatch` envelope and appends the pull door's own hint: remove the key from `connectorSource.input` or declare it in the action (for `openapi`, in the OpenAPI document). When the undeclared key is the watermark parameter the door added itself (judged alone against the schema, so the sentence never blames the watermark for an author's key), the refusal names it and says to declare it as an `in: query` parameter of the operation. - `connector-pull.test.ts`: the pin `[objectstack-ai#33553] an undeclared key is not refused here` (formerly 385-398) is flipped in place to a refusal pin: `code` + `status` + `reason`, both undeclared keys named, handler never called, nothing written. - New `connector-pull-undeclared-input-key.test.ts` (named by the card): the door-added watermark key. An openapi-shaped operation that lists only `query.limit`, and one that emits no `query` section, both refuse `since` naming it and the OpenAPI fix; an author's stray key with the watermark declared does not mention the watermark. Controls: the declared watermark is sent; the first pull (nothing stored) sends no watermark and is not refused; a `rest` connector's open `query` takes the watermark as before. - `packages/spec/src/data/mapping.zod.ts` (`connectorSource.input` describe) and the generated `content/docs/references/data/mapping.mdx`: input is judged before the call; an undeclared key is refused, the watermark parameter included. - New semantic migration entry `18.connector-pull-undeclared-input-key-refused` (entry 18 `connector-action-undeclared-input-key-refused`, shipped in 18.5.0, is not touched). - `content/docs/automation/jobs.mdx`: the `connectorSource` run bullet says the input is judged, names the watermark parameter and the OpenAPI fix, and that a scheduled run has no `fault` edge, so the refusal fails every run until fixed. - BREAKING changeset (`minor` on `@objectstack/service-automation` and `@objectstack/spec`) with the ADR-0087 marker and the FROM → TO migration. **For the sync-in owner (ADR-0153 D2, Proposed):** when the pull door starts sending paging parameters (`connectorSource.paging`), they are judged by this same rule, so the design now presumes the read action declares them; a paging parameter an `openapi` operation does not list will be refused like the watermark. ## Tests <details><summary>Touched-package suites and typecheck (head before the last main merge; re-run touched files on the final head where noted)</summary> - `pnpm --filter @objectstack/service-automation test`: Test Files 283 passed (283), Tests 4003 passed (4003). - `pnpm --filter @objectstack/service-automation typecheck` (tsc + check:test-typecheck): exit 0 after typing the new file's handler (first run named TS2493 in the new file, fixed). - `pnpm --filter @objectstack/spec test`: Test Files 842 passed (842), Tests 26961 passed, 1 todo; `pnpm --filter @objectstack/spec typecheck`: exit 0. - `pnpm --filter @objectstack/spec check:generated`: 1 of 14 stale (`check:docs`), regenerated with `--fix`, committed. - The four connector-pull files (unit, new file, integration through the real `rest` connector, service door): 64 passed. </details> <details><summary>Ablations (each red, then restored with blob == HEAD and git diff HEAD empty)</summary> - A, drop `{ refuseUndeclaredKeys: true }` from the door's judge: 4 failed (the flipped pin and three new-file pins), "the pull must refuse, not resolve: expected undefined to be an instance of ConnectorPullError". - B, never name the watermark (`addedUndeclared = false`): 2 failed, "expected ... to contain 'watermark parameter 'since''". - C, make the watermark probe always undeclared: 1 failed, "expected ... not to contain 'watermark parameter'". </details> ## Acceptance notes - First pull edge: the watermark parameter is sent only once the target holds a value, so a mapping whose operation does not declare it pulls once and fails from the second run on. The changeset, the migration entry and the refusal say so; judging it on the first pull too would be a further narrowing not in the ruling. - `connector-input-schema.ts`'s header and `ConnectorInputJudgeOptions.refuseUndeclaredKeys` doc name only the `connector_action` node as the door that opts in; they stay true but incomplete (outside the claim's file surface, left untouched). - `packages/spec/docs/SYNC_ARCHITECTURE.md` says the pull judges required parameters and types "as a `connector_action` flow node's is"; it does not list the undeclared-key refusal (outside the claim's file surface). - The 18.5.0 changeset for the node half ends "The connector pull door (`connectorSource.input`) is unchanged."; released text, true when shipped, superseded by this changeset; not edited here. ## Verification - Hot-file rule: no open PR shares a file with this branch (59 open PRs' file lists read). `git merge-tree --write-tree --name-only` against origin/main and the two PRs that add sibling files in `entries/semantic/` (objectstack-ai#33970, objectstack-ai#34001): exit 0, no conflicted paths. - Dogfood battery and the derived gate subset: see the report comment on the card. --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
Requested by Steedos · project thread
Fixes #32733
Clause-②: no
Metadata-protocol: none
维护者速读
{ id }形状,就整体按「读不到」处理(不判),不再过滤后误拒所有渠道;迁移说明条目补齐两种不判情形和路径写法。packages/runtime/src/domains/automation.ts(refuseUnknownNotifyChannels的读取段)、新增 pin、18.notify-channel-unknown-refused.ts。pnpm --filter @objectstack/runtime exec vitest run src/domains/automation-authoring-doors-durable.test.ts,预期全部通过。What changes
getKnownChannels()answers a list with any member that is not a{ id: string }, the registry is now treated as unreadable: nothing is judged and the save goes on. The declared channel contract, which the check reads structurally inpackages/runtime/src/domains/automation.ts, isinterface NotifyChannelRegistry { getKnownChannels(): ReadonlyArray<{ id: string; configured: boolean }> }. Its docblock says: "Every channel the service knows: the ones registered directly, and each lazy provider (email,sms,push) whether or not its transport is installed yet." Its one producer,MessagingService.getKnownChannels()in@objectstack/service-messaging, answersArray<{ id: string; configured: boolean }>. A list off that shape is outside the contract, so it gives no verdict, the same as a reader that throws or answers no list. Before, such members were dropped and the shrunken roster refused every channel the node named. Removing that false refusal is outside any declared accept set and changes no authorable key:Clause-②: no,Metadata-protocol: none.notify-channel-unknown-refused(packages/spec, data text only) now names every not-judged case the doors have, as the released changelog entry does, and the paths a refusal names. Review face:CONTRACT_REVIEW_TIER(packages/spec data text).relevantWhen, read byos migrate meta, but its contract says to omit it unless the surface lives only under top-level stack keys; a flow saved through the/automationdoors is stored runtime metadata, outside the stack, so astack-declaresquestion cannot prove it absent. Same for the picklist sibling.Tests
automation-authoring-doors-durable.test.ts: a reader answering bare ids, and a list with one bare id, both save 200 with the node namingemail.scripts/ablation-replace.mjs):× a list with any member that is not a { id: string } is unreadable… AssertionError: reader-bare-ids: expected 400 to be 200; restored, blob equals HEAD,git diff HEADempty.Acceptance notes
content/docs/automation/flows.mdxdoes not list the two not-judged cases (beforekernel:ready, an unreadable reader) nor the list-member and region-body paths; it is outside this PR's surface.Verification
All readings at head
f3979189, which is42667cd1merged withorigin/main. That main includes #33721 (83198201), whoseautomation.tshunks do not touch thegetKnownChannels()read. The merge was clean, and the PR delta is exactly the four files below.^...closure build exit 0; runtime typecheck exit 0; spec typecheck exit 0.src/migrations:Test Files 5 passed / Tests 198 passed.19 passed (19).Tests 1 failed | 18 passed,AssertionError: reader-bare-ids: expected 400 to be 200. Restored: blobd39570fc2127equals HEAD.Test Files 605 passed (605) / Tests 10959 passed | 19 skipped.--no-inline-configon the three touched.tsfiles: exit 0.dispatch-gates --commands: 94 families, all run, reconciled with--ran(94 derived, 94 run). All exit 0 exceptcheck:dual-build-cjs-loads: NOT MEASURED, because it needs a fullpnpm build.check:dts-closureandcheck:lean-entry-closurefirst exited 3 before the closure was built, then 0 when re-run after it.Generated by Claude Code
🤖 Generated with Claude Code